package l1j.opqlo.NewSystem;

import l1j.opqlo.Server.L1World.L1World;
import l1j.server.server.IdFactory;
import l1j.server.server.datatables.NpcTable;
import l1j.server.server.model.L1NpcDeleteTimer;
import l1j.server.server.model.Instance.L1NpcInstance;

public class L1Store {
	public class L1StoreStart implements Runnable {
		@Override
		public void run() {

		}
	}

	private static int[] _npc = { 45008, 45016, 45019, 45024 };
	private static int[] _npcx = { 32773, 32774, 32775, 32776 };

	private static int[] _npcy = { 32778, 32778, 32778, 32778 };

	private static boolean playing;

	public static void setPlaying(boolean i) {
		playing = i;
	}

	public static void StartGame() {
		setPlaying(true);
		for (int i = 0; i < _npc.length; i++) {
			final L1NpcInstance npc = NpcTable.getInstance().newNpcInstance(
					_npc[i]);
			npc.setId(IdFactory.getInstance().nextId());
			npc.setMap((short) 5051);
			npc.setX(_npcx[i]);
			npc.setY(_npcy[i]);
			npc.setHomeX(npc.getX());
			npc.setHomeY(npc.getY());
			npc.setHeading(0);

			L1World.getInstance().storeObject(npc);
			L1World.getInstance().addVisibleObject(npc);

			npc.turnOnOffLight();
			npc.startChat(L1NpcInstance.CHAT_TIMING_APPEARANCE); // チャット開始

			final L1NpcDeleteTimer timer = new L1NpcDeleteTimer(npc, 300000);
			timer.begin();

		}
	}

	public boolean getPlaying() {
		return playing;
	}
}
